/* 图形测试页面样式 */
.graphics-test-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  position: relative;
  overflow: hidden;
}

/* 背景网格效果 */
.graphics-test-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

/* 顶部导航 */
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.header-spacer {
  flex: 1;
}

.back-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.return-title-button {
  width: 160px;
  height: 40px;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.9;
  background-color: transparent;
  flex-shrink: 0;
}

.return-title-button:hover {
  opacity: 1;
  transform: scale(1.05);
}

.return-title-button:active {
  transform: scale(0.95);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.test-record-button {
  width: 140px;
  height: 40px;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.test-record-button:hover {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.test-record-button:active {
  transform: scale(0.95);
}

.music-icon {
  font-size: 20px;
  opacity: 0.8;
}

/* 测试说明 */
.test-instruction {
  display: flex;
  align-items: flex-start;
  padding: 0 20px 30px;
  position: relative;
  z-index: 10;
}

.instruction-icon {
  color: #FF6B6B;
  font-size: 16px;
  margin-right: 10px;
  margin-top: 2px;
  flex-shrink: 0;
}

.instruction-text {
  color: white;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  text-shadow: 
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0   -1px 0 #000,
     0    1px 0 #000,
    -1px   0  0 #000,
     1px   0  0 #000;
}

/* 图案选择区域 */
.patterns-container {
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.patterns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.pattern-item {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
}

.pattern-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pattern-item.selected {
  border: 3px solid #FF9500;
  background: transparent;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}

.pattern-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.pattern-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* 图案样式 - 所有图案现在都使用PNG图片实现 */

/* 开始测试按钮 */
.test-actions {
  padding: 0 20px 40px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.start-test-button {
  width: 200px;
  height: 60px;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background-color: transparent;
  display: block;
  margin: 0 auto;
}


.start-test-button:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.start-test-button:active {
  transform: scale(0.95);
}

.start-test-button:not(.active) {
  opacity: 0.5;
  cursor: not-allowed;
}

.start-test-button:not(.active):hover {
  transform: none;
  opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .patterns-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  
  .pattern-item {
    padding: 0;
    min-height: 60px;
  }
  
  .return-title-button {
    width: 140px;
    height: 32px;
  }
  
  .test-record-button {width: 110px;
    height: 30px;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .instruction-text {
    font-size: 14px;
  }
  
  .start-test-button {
    width: 180px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .patterns-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
  
  .pattern-item {
    padding: 0;
    min-height: 56px;
  }
  
  .test-header {
    padding: 15px;
  }
  
  .return-title-button {
    width: 120px;
    height: 28px;
  }
  
  .test-record-button {
    width: 110px;
    height: 30px;
  }
  
  .header-right {
    gap: 6px;
  }
  
  .test-instruction {
    padding: 0 15px 20px;
  }
  
  .patterns-container {
    padding: 0 15px;
  }
  
  .test-actions {
    padding: 0 15px 30px;
  }
  
  .start-test-button {
    width: 160px;
    height: 45px;
  }
}
